package config

import (
	"github.com/spf13/viper"
	"log"
)

type AppConfig struct {
	MysqlYun
}
type MysqlYun struct {
	Host     string
	Port     int
	User     string
	Password string
	Database string
}

var AppConf AppConfig

func InitsConfig() {
	viper.SetConfigFile("./config/dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		print(err)
		return
	}
	log.Println("配置读取信息成功")
	err = viper.Unmarshal(&AppConf)
	if err != nil {
		print(err)
		return
	}
	log.Println("配置解析信息成功")
}
